home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Development / General / ViewIt™ 2.24 Shareware / FaceWare / FaceWare.rsrc / TEXT_1276_U3. Window Utilities.txt < prev    next >
Text File  |  1994-04-10  |  8KB  |  110 lines

  1. U3. Window Utility Commands
  2.   Several ViewIt commands are supported that deal with the managing of window-related attributes such as style, title, zoom state, order, and position.
  3.  
  4. Name  Number  Parameters & Variables used
  5. SetFSS  183  a,b,c,d,uString,uResult
  6.   Resets the font, size, and style fields of the designated window or port.  Passing a value of -1 for b, c, or d causes ViewIt to ignore that parameter.  If the port's font, size, or style is changed, then ViewIt returns uResult ‚↠0.
  7.   a = target window or port
  8.     0 = front modal or active modeless window
  9.     1 = current port
  10.     other = WindowPtr or GrafPtr
  11.   b = font number
  12.    or b = -2 = get font name from uString
  13.    or b = address of a Pascal string containing font name
  14.   c = font size (12 pt. used if c = 0)
  15.   d = style = sum of following:  0 = Plain,
  16.     1 = Bold, 2 = Italic, 4 = Underline, 8 = Outline,
  17.     16 = Shadow, 32 = Condensed, 64 = Extended
  18. NOTE:  SetFSS does not change the appearance of text in an existing window.  It only changes the appearance of new text drawn by the program after calling SetFSS (i.e., it has the same effect as calling TextFont, TextSize, and TextFace).
  19.  
  20. SndBhd  250  a,b,d
  21.   Moves a window to a new location in the window list (i.e., above or below some other window).  SndBhd also calls ShowWindow to show the window if it is not already visible.  Avoid using SndBhd if a modal window is the front window.
  22.   a = WindowPtr of window to move
  23.   b = where to move the window in window list
  24.     1 = send to back (below all other windows)
  25.     0 = bring to front, but below any FaceIt floating palettes
  26.    -1 = bring to front using "SelectWindow"
  27.    -2 = bring to front without calling "SelectWindow"
  28.     other = WindowPtr of a window to send window a behind
  29.   d = update mode (same use as in ViewIt's DoUpdt)
  30. The b = -1 or -2 options are primarily for FaceWare's internal use.  The most common use of SndBhd is to bring a modeless window to the front:
  31.  FaceIt(nil,SndBhd,ord(myWindow),0,0,-1);
  32. where d = -1 updates window contents and other stuff.
  33.  
  34. GetNam  251  a,b,c,uName
  35.   Returns all or part of a window's current title in uName (if c = 0), or in the Pascal string whose address is given by c, where a is the window's WindowPtr, and b designates which part of the title to return:  0 = entire title, 1 = window name only, 2 = file name only (the text between "{" and "}"), or 3 = file name if not empty, else window name.
  36. NOTE:  This command is primarily used by modules that make use of a window's title to display a file name.
  37.  
  38. SetNam  252  a,b,c,uName
  39.   Resets all or part of a window's current title to uName (if c = 0), or to the Pascal string whose address is given by c, where a is the window's WindowPtr, and b designates which part of the title to reset:  0 = entire window title, 1 = window name only, and 2 = file name only (the text in the title that is between "{" and "}").
  40. NOTE:  This command is primarily used by modules that make use of a window's title to display a file name.
  41.  
  42. MovRec  254  a,b,c,d,uRect
  43. MovAlt  255  a,b,c,d
  44. MovDlg  256  a,b,c,d
  45. MovWin  257  a,b,c,d
  46.   Moves a rectangle to the screen position designated by the parameters b, c, and d.  For MovRec, uRect is adjusted.  For MovAlt, MovDlg, and MovWin, the boundsRect of the corresponding ALRT, DLOG, or WIND resource (in memory, not on disk) whose resource ID is equal to a is adjusted.  The resulting rectangle is always kept within the visible screen area.  MovRec can also be used to move an existing window by passing a WindowPtr in parameter a.
  47.   a = resource ID of ALRT, DLOG, or WIND (not MovRec)
  48.    or window procID‚Ć (MovRec only)
  49.    or WindowPtr of window to move (MovRec only)
  50.   b = what device (screen), window, or position to use as basis for movement
  51.    -2 =  c and d are global coordinates
  52.    -1 = all devices
  53.     0 = main device (screen with menu bar)
  54.     1 = deepest device (greatest bits per pixel)
  55.     2 = front window‚Ć‚Ć
  56.     3 = current cursor location
  57.     4 = current device that contains cursor
  58.     5 = window w/ selected control or active modeless or front modal window‚Ć‚Ć
  59.     6 = global rectangle passed in uRect
  60.     7 = active modeless or front modal window‚Ć‚Ć
  61.     other = WindowPtr of an existing window
  62.   c = vertical placement‚Ć‚Ć‚Ć
  63.     0 = no change
  64.     1 = centered
  65.     2 = at top
  66.     3 = at bottom
  67.     4 = 1/3 of distance from top to bottom
  68.     other = pixel offset from top
  69.   d = horizontal placement‚Ć‚Ć‚Ć
  70.     0 = no change
  71.     1 = centered
  72.     2 = at left
  73.     3 = at right
  74.     other = pixel offset from left
  75. A typical use of MovDlg, for example, would be to adjust the boundsRect of a DLOG resource before opening a new dialog window,
  76.  FaceIt(nil,MovDlg,1000,0,1,1);
  77. which would center DLOG 1000 on the main screen.  The MovRec command, on the other hand, could be used to move a hidden window into position before it is shown:
  78.  FaceIt(nil,MovRec,ord(myWindow),7,1,1);
  79. which would center "myWindow" above the front modal or active modeless window.  Another common use of MovRec is to force a window to be completely visible when part of it might be out of view:
  80.  FaceIt(nil,MovRec,ord(myWindow),-1,0,0);
  81. which will only move the window if part of it is off-screen.
  82. ‚Ć When using MovRec to adjust the position of uRect, the procID or "window definition ID" passed in parameter a is used to account for the title bar and border area of a window that might be formed from uRect.  Use a = procID = 2, for example, to minimize the correction for title bar and border since this corresponds to a window with no title bar and a minimal border.
  83. ‚Ć‚Ć Passing b = 2 bases movement on the front window, even if it is a floating window.  If positioning one window above another, it will usually make more sense to pass b = 5 which uses either the window with the selected control, the active modeless window, or, if one or more modal windows are open, the top modal window.
  84. ‚Ć‚Ć‚Ć ViewIt's positioning of windows via c and d conflicts with the System 7 "Auto Position" option seen in ResEdit, so do not set this option for resources that will be positioned by ViewIt.
  85.  
  86. DrgWnd  259  a,b,c,d,uRect
  87.   Drags and, if d ‚↠0, selects the designated window.  This command does not call "DragWindow" or "SelectWindow", making it useful in cases where these traps may have been patched and the caller wishes to drag and select the window in a controlled manner (ViewIt uses DrgWnd, for example, when in editing mode).
  88.   a = WindowPtr (or 0 for front modal or active modeless)
  89.   b = starting point of drag (global coordinates)
  90.   c = address of bounding rect (or 0 = use fDragRect)
  91.   d = selection and update mode
  92.     0 = don't select after drag
  93.     other = update mode defined by ViewIt's DoUpdt
  94.  
  95. GetStd  301  a,uRect
  96.   Returns in uRect the maximum standard state zoom rect for the window designated by WindowPtr a.  The rectangle is adusted to properly fit within whichever screen device contains the top, left corner of the content area of window a.
  97.  
  98. SetStd  302  a,uRect
  99.   Uses the contents of uRect to reset the standard zoom state rectangle of the window designated by WindowPtr a. SetStd is typically called by modules after "fine tuning" the uRect returned by GetStd.
  100.  
  101. SavDlg  356  a,b,c,d
  102. SavWin  357  a,b,c,d
  103.   Updates and then saves a DLOG or WIND resource back to disk where,
  104.   a = WindowPtr to get boundsRect rectangle from
  105.   b = resource ID of DLOG (SavDlg) or WIND (SavWin)
  106.   c = value to place in refCon field of resource
  107.    (or -1 to use window's current refCon value)
  108.   d = value (0 = F, 1 = T) to put in visible field of resource
  109.    (or -1 to use window's current visibility)
  110. NOTE:  This command has been made largely obsolete by the new ViewIt module which uses custom FWND resources.